import request from '@/utils/request'

// 查询章节加简易列表
export function listSimpleChapter(courseId) {
  return request({
    url: '/course/chapter/listSimple',
    method: 'get',
    params: courseId
  })
}

// 查询章节列表
export function listChapter(query) {
  return request({
    url: '/course/chapter/list',
    method: 'get',
    params: query
  })
}

// 查询章节详细
export function getChapter(chapterId) {
  return request({
    url: '/course/chapter/' + chapterId,
    method: 'get'
  })
}

// 新增章节
export function addChapter(data) {
  return request({
    url: '/course/chapter',
    method: 'post',
    data: data
  })
}

// 修改章节
export function updateChapter(data) {
  return request({
    url: '/course/chapter',
    method: 'put',
    data: data
  })
}

// 删除章节
export function delChapter(chapterId) {
  return request({
    url: '/course/chapter/' + chapterId,
    method: 'delete'
  })
}

// 视频绑定章节
export function addChapterVideo(chapterVideos) {
  return request({
    url: '/course/chapter/video',
    method: 'post',
    data: chapterVideos,
  })
}


// 查询章节视频列表通过章节id
export function chapterVideoList(chapterId) {
  return request({
    url: '/course/chapter/video/list',
    method: 'get',
    params: chapterId,
  })
}


// 查询章节视频详情通过章节id与视频id
export function chapterVideoInfo(query) {
  return request({
    url: '/course/chapter/video',
    method: 'get',
    params: query,
  })
}

// 修改章节视频
export function updateChapterVideo(chapterVideo) {
  return request({
    url: '/course/chapter/video',
    method: 'put',
    data: chapterVideo,
  })
}

// 删除章节视频
export function delChapterVideo(chapterVideo) {
  return request({
    // url: '/course/chapter/video',
    // method: 'put',
    // data: chapterVideo,
  })
}


// 查询章节视频已绑定题目列表通过章节id
export function videoBindQuList(id) {
  return request({
    url: '/course/chapter/video/bindQu/list',
    method: 'get',
    params: id,
  })
}

// 章节视频解绑题目
export function videoDelQu(query) {
  return request({
    url: '/course/chapter/video/qu/del',
    method: 'put',
    params: query,
  })
}

// 查询章节视频未绑定题目列表
export function videoUnBindQuList(query) {
  return request({
    url: '/course/chapter/video/unBindQu/list',
    method: 'get',
    params: query,
  })
}

// 章节视频绑定题目
export function videoAddQu(query) {
  return request({
    url: '/course/chapter/video/qu/add',
    method: 'put',
    params: query,
  })
}


// 附件绑定章节
export function addChapterRes(chapterRess) {
  return request({
    url: '/course/chapter/res',
    method: 'post',
    data: chapterRess,
  })
}


// 查询章节附件列表通过章节id
export function chapterResList(chapterId) {
  return request({
    url: '/course/chapter/res/list',
    method: 'get',
    params: chapterId,
  })
}


// 查询章节附件详情通过附件id
export function chapterResInfo(resId) {
  return request({
    url: '/course/chapter/res/' + resId,
    method: 'get',
  })
}

// 修改章节附件
export function updateChapterRes(res) {
  return request({
    url: '/course/chapter/res',
    method: 'put',
    params: res,
  })
}

// 删除章节附件
export function delChapterRes(chapterRes) {
  return request({
    // url: '/course/chapter/res',
    // method: 'put',
    // data: chapterRes,
  })
}






